package com.sys.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

@ControllerAdvice
public class GlobalExceptionController {
    @ExceptionHandler(RuntimeException.class)
    public ModelAndView errorHandler(RuntimeException e){
        System.out.println("e = [" + e.getMessage() + "]");
        return new ModelAndView("error","ex",e);
    }
}
